package edu.gdkm.dao;

import edu.gdkm.pojo.Course;
import edu.gdkm.pojo.Teacher;
import org.apache.ibatis.annotations.*;

public interface ITeacherDao {
    @Select("select * from t_teacher where tid=#{id}")
    public Teacher queryTeacherById(Integer id);

    @Select("select * from t_teacher where tid=#{id}")
    @Results({
            @Result(property = "tid",column = "tid"),
            @Result(
                    property = "courseList",
                    column = "tid",
                    many=@Many(select = "edu.gdkm.dao.ICourseDao.queryCourseByCid")
            )
    })
    public Teacher queryTeacherByTid(Integer id);
}
